package cash.cmp.personal_financial_system.model;


import cash.cmp.personal_financial_system.utils.easyexcel.converter.PayConverter;
import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;

import java.util.Date;

public class Bill {

    @ExcelProperty("用户编号")
    int id;
    @ExcelProperty("账单编号")
    String billId;
    @ExcelProperty("账单名")
    String billName;
    //此处的type通过两张表查询，直接转成String字符串类型
    @ExcelProperty("记账类型")
    String type;

    @ExcelProperty("记账大类型")
    String bigType;

    //  @DateTimeFormat(pattern="yyy-MM-dd HH:mm:ss"), 后端传给前端
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    @ExcelProperty("记账时间")
    Date time;
    @ExcelProperty("记账金额")
    double money;
    @ExcelProperty("备注")
    String remark;
    //0代表收入，1代表支出
    @ExcelProperty(value = "账单类型",converter = PayConverter.class)
    int billType;
    //用于大数据分区
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    @ExcelProperty("插入时间")
    Date insertionTime;
    @Override
    public String toString() {
        return "Bill{" +
                "id=" + id +
                ", billId='" + billId + '\'' +
                ", billName='" + billName + '\'' +
                ", type='" + type + '\'' +
                ", bigType='" + bigType + '\'' +
                ", time=" + time +
                ", money=" + money +
                ", remark='" + remark + '\'' +
                ", billType=" + billType + '\'' +
                ", insertionTime=" + insertionTime +
                '}';
    }

    public Bill() {
    }

    public Bill(int id,String billId, String billName, String type, Date time, double money, String remark, int bill_type, Date insertionTime, String bigType) {
        this.id = id;
        this.billId = billId;
        this.billName = billName;
        this.type = type;
        this.bigType = bigType;
        this.time = time;
        this.money = money;
        this.remark = remark;
        this.billType = bill_type;
        this.insertionTime = insertionTime;
    }

    public String getBigType() {
        return bigType;
    }

    public void setBigType(String bigType) {
        this.bigType = bigType;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getBillId() {
        return billId;
    }

    public void setBillId(String billId) {
        this.billId = billId;
    }

    public String getBillName() {
        return billName;
    }

    public void setBillName(String billName) {
        this.billName = billName;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public Date getTime() {
        return time;
    }

    public void setTime(Date time) {
        this.time = time;
    }

    public double getMoney() {
        return money;
    }

    public void setMoney(double money) {
        this.money = money;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public int getBillType() {
        return billType;
    }

    public void setBillType(int billType) {
        this.billType = billType;
    }

    public Date getInsertionTime() {
        return insertionTime;
    }

    public void setInsertionTime(Date insertionTime) {
        this.insertionTime = insertionTime;
    }
}
